#ifndef _BARTER_SERVER_SHA512_H_
#define _BARTER_SERVER_SHA512_H_

#ifdef __cplusplus
extern "C" {
#endif

typedef struct StateSHA512_t
{
	unsigned long long Bits[2];
	unsigned long long Digest[8];
	unsigned char Buffer[128];
	unsigned long Index;
} StateSHA512;

/*
	Build key sequence and initialize the buffer with IV
*/
int SHA512_Init(StateSHA512*);
int SHA512_Update(StateSHA512*, const char*, int); // state, string, string length
int SHA512_Final(StateSHA512*, unsigned char out[64]); // out: 512 bit digest

#ifdef __cplusplus
}
#endif

#endif // _BARTER_SERVER_SHA512_H_
